import groovy.jmx.builder.node.OpNodeData
import groovy.jmx.builder.node.SimpleNodeData

class OpNodeDataTest extends GroovyTestCase {
    void testOpNodeDataConstructor() {
        OpNodeData op = new OpNodeData(name: "Op", description: "Description", parameters: [new SimpleNodeData(value: "Node1")])
        assert op.name == "Op"
        assert op.description == "Description"
        assert op.parameters.size == 1
        assert op.parameters[0].value == "Node1"
    }

    void testOpNodeDataSetter() {
        OpNodeData op = new OpNodeData()
        op.name = "Op"
        op.description = "Description"
        op.parameters = [new SimpleNodeData(value: "Node1"), new SimpleNodeData(value: "Node2")]

        assert op.name == "Op"
        assert op.description == "Description"
        assert op.parameters.size == 2
        assert op.parameters[0].value == "Node1"
        assert op.parameters[1].value == "Node2"
    }
}